﻿<div class="main-box border-line">
    <div class="main-title">
        <span>Edit Profiles</span>
    </div>
    <div class="main-content">
    <h3 class="title-bg"><?php echo $model->display_name; ?></h3>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-profiles-form',
	'enableAjaxValidation'=>false,
    'htmlOptions'=>array (
        'enctype'=>'multipart/form-data',
    ),
)); ?>
	<?php echo $form->errorSummary($model); ?>
    <div class="row">
		<?php echo $form->hiddenField($model,'id'); ?>
	</div>
    
    <div class="user-detail">
        <div class="user-detail-01">
        <div class="user-detail-avatar">
        <fieldset>
        <legend>Avatar</legend>
            <div class="comment-avatar border-shadow"><img src="<?php if($model!=null AND $model->avatar!=null){ echo Yii::app()->request->baseUrl;?>/data/<?php echo $model->avatar;} else echo Yii::app()->request->baseUrl."/images/noavatar.gif";?>" height="100px" width="100px" /></div>
        </fieldset>
        </div>
        
        <div class="user-detail-name">
        <fieldset>
        <legend>Name</legend>
            <p><b><?php echo $form->labelEx($model,'display_name'); ?></b>
            <span><?php echo $form->textField($model,'display_name',array('size'=>30,'maxlength'=>50)); ?></span>
            <?php echo $form->error($model,'display_name'); ?></p>

            <p><b><?php echo $form->labelEx($model,'avatar'); ?></b>
            <span><?php echo CHtml::activeFileField($model,'avatar'); ?></span>
            <?php echo $form->error($model,'avatar'); ?></p>
        </fieldset>
        </div>
        </div>
        <div class="user-detail-02">
        <fieldset>
        <legend>Basic Informations</legend>
            <p><b><?php echo $form->labelEx($model,'first_name'); ?></b>
            <span><?php echo $form->textField($model,'first_name',array('size'=>50,'maxlength'=>50)); ?></span>
            <?php echo $form->error($model,'first_name'); ?></p>
            <p><b><?php echo $form->labelEx($model,'last_name'); ?></b>
            <span><?php echo $form->textField($model,'last_name',array('size'=>50,'maxlength'=>50)); ?></span>
            <?php echo $form->error($model,'last_name'); ?></p>

            <p><b><?php echo CHtml::activeLabelEx($model,'dob'); ?></b>
            <span><?php $this->widget('zii.widgets.jui.CJuiDatePicker',
		              array(
                			'name'=>'UserProfiles[dob]',
                			'value'=>$model->dob,
                			'language'=>'en',
                			'options'=> array(
                					'dateFormat'=>'yy-mm-dd',
                					'changeMonth'=>true,
                					'changeYear'=>true,
                					'showButtonPanel' => 'true',
                					'constrainInput' => 'false',
                					'duration'=>'fast',
                					'showAnim' =>'slide',
                					),
                		)
                	); ?></span>
            <?php echo $form->error($model,'dob'); ?></p>

            <p><b><?php echo $form->labelEx($model,'company'); ?></b>
            <span><?php echo $form->textField($model,'company',array('size'=>60,'maxlength'=>100)); ?></span>
            <?php echo $form->error($model,'company'); ?></p>
        </fieldset>
        </div>
        <div class="user-detail-03">
        <fieldset>
        <legend>Advance Informations</legend>
            <p><b><?php echo $form->labelEx($model,'gender'); ?></b>
            <span><?php echo $form->dropDownList($model,'gender',$model->getTypeGender()); ?></span>
            <?php echo $form->error($model,'gender'); ?></p>

            <p><b><?php echo $form->labelEx($model,'phone'); ?></b>
            <span><?php echo $form->textField($model,'phone',array('size'=>20,'maxlength'=>20)); ?></span>
            <?php echo $form->error($model,'phone'); ?></p>

            <p><b><?php echo $form->labelEx($model,'mobile'); ?></b>
            <span><?php echo $form->textField($model,'mobile',array('size'=>20,'maxlength'=>20)); ?></span>
            <?php echo $form->error($model,'mobile'); ?></p>

            <p><b><?php echo $form->labelEx($model,'address_line1'); ?></b>
            <span><?php echo $form->textField($model,'address_line1',array('size'=>60,'maxlength'=>255)); ?></span>
            <?php echo $form->error($model,'address_line1'); ?></p>
            
            <p><b><?php echo $form->labelEx($model,'address_line2'); ?></b>
            <span><?php echo $form->textField($model,'address_line2',array('size'=>60,'maxlength'=>255)); ?></span>
            <?php echo $form->error($model,'address_line2'); ?></p>
            
            <p><b><?php echo $form->labelEx($model,'address_line3'); ?></b>
            <span><?php echo $form->textField($model,'address_line3',array('size'=>60,'maxlength'=>255)); ?></span>
            <?php echo $form->error($model,'address_line3'); ?></p>

            <p><b><?php echo $form->labelEx($model,'yim_handle'); ?></b>
            <span><?php echo $form->textField($model,'yim_handle',array('size'=>60,'maxlength'=>100)); ?></span>
            <?php echo $form->error($model,'yim_handle'); ?></p>

            <p><b><?php echo $form->labelEx($model,'skype_handle'); ?></b>
            <span><?php echo $form->textField($model,'skype_handle',array('size'=>60,'maxlength'=>100)); ?></span>
            <?php echo $form->error($model,'skype_handle'); ?></p>

            <p><b><?php echo $form->labelEx($model,'website'); ?></b>
            <span><?php echo $form->textField($model,'website',array('size'=>60,'maxlength'=>255)); ?></span>
            <?php echo $form->error($model,'website'); ?></p>

            <p><b><?php echo $form->labelEx($model,'facebooksite'); ?></b>
            <span><?php echo $form->textField($model,'facebooksite',array('size'=>60,'maxlength'=>100)); ?></span>
            <?php echo $form->error($model,'facebooksite'); ?></p>

            <p><b><?php echo $form->labelEx($model,'bio'); ?></b>
            <span><?php $this->widget('application.extensions.cleditor.ECLEditor',
            array('name'=>'UserProfiles[bio]',
                'value'=>$model->bio,
            )); ?></span>
            <?php echo $form->error($model,'bio'); ?></p>
        </fieldset>
        </div>
        <div class="user-detail-04"></div>
        
        <div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
        </div>
    </div>
<?php $this->endWidget(); ?>

</div><!-- form -->
    </div>
</div>